<?php
header("Content-type: text/html; charset=utf-8");

//连接数据库
$conn = mysql_connect("10.4.12.173:3306", 'ugZ27ryCUMywR', 'pPUZZaXlve6GK');
if (!$conn)
{
    echo "<script>alert('数据库连接失败')</script>";
	die();
}
mysql_select_db("dc772e1acdec14be7a389e8ccf9077224", $conn);
try{
$sql_str = 'SELECT * FROM result order by total DESC';
mysql_query("set names utf8");
$result = mysql_query( $sql_str);

$rank = 1;
while ($row=mysql_fetch_row($result))
    {
		echo '<tr>';
        echo '<td>'.$rank.'</td>';
		for ($i=0; $i<mysql_num_fields($result); $i++ )
		{
			echo '<td>';
			echo $row[$i];
			echo '</td>';
		}
		echo '</tr>';
        ++$rank;
    }
} catch (Exception $e) {
	echo "查询失败，请联系QQ564165484";
	exit();
}
mysql_close();
?>